﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.AutoMapper;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using AutoMapper;
using FwProject.Authorization.Users;
using FwProject.Core.Restaurant;
using Newtonsoft.Json;

namespace FwProject.Restaurant.Dto
{
    [AutoMap(typeof(RestaurantInfo))]
    public class RestaurantDto : Entity<Guid>,ICreationAudited
    {
        [Display(Name ="所属工厂")]
        public Guid? FactoryInfoId { get; set; }

        /// <summary>
        /// 餐厅名称
        /// </summary>
        /// <value>The name of the restaurant.</value>

        [Display(Name = "餐厅名称")]
        public string RestaurantName { get; set; }

        /// <summary>
        /// 餐厅地址
        /// </summary>
        /// <value>The restaurant address.</value>
        [Display(Name = "餐厅地址")]
        public string RestaurantAddress { get; set; }

        /// <summary>
        /// 经度
        /// </summary>
        /// <value>The longitude.</value>
      
        [Display(Name = "经度")]
        public string longitude { get; set; }


        /// <summary>
        /// 纬度
        /// </summary>
        /// <value>The latitude.</value>

        [Display(Name = "纬度")]
        public string latitude { get; set; }
        /// <summary>
        /// 餐厅绑定司机
        /// </summary>
        /// <value>The employee driverid.</value>

        [Display(Name = "司机编号")]
        public long EmployeeDriverid { get; set; }

        public User EmployeeDriver { get; set; }
        /// <summary>
        /// 拼音首字母
        /// </summary>
        /// <value>The character.</value>

        [Display(Name = "拼音首字母")]
        public string Character { get; set; }
        /// <summary>
        /// 餐厅logo 图片
        /// </summary>
        /// <value>The thump.</value>

        [Display(Name = "餐厅logo图片")]
        public string Thump { get; set; } = RestaurantInfo.SavePath;

        /// <summary>
        /// 收费方式
        /// </summary>
        [Display(Name = "收费方式")]
        public ChargeWayEnum ChargeWay { get; set; } = ChargeWayEnum.按套收费;
        /// <summary>
        /// 结算方式
        /// </summary>
        [Display(Name = "结算方式")]
        public BalanceWayEnum BalanceWay { get; set; } = BalanceWayEnum.定期结算;
        /// <summary>
        /// 结算周期
        /// </summary>
        [Display(Name = "结算周期")]
        public BalanceCycleEnum BalanceCycle { get; set; } = BalanceCycleEnum.每月定期;
        /// <summary>
        /// 是否停用
        /// </summary>
        [Display(Name = "停用标志")]
        public bool IsDiscontinuation { get; set; } = false;
        /// <summary>
        /// 停用时间
        /// </summary>
        [Display(Name ="停用时间")]
        public DateTime? DiscontinuationTime { get; set; }
        /// <summary>
        /// 收取押金
        /// </summary>
        [Display(Name = "押金金额")]
        public decimal Deposit { get; set; }
        /// <summary>
        /// 押金收取日期
        /// </summary>
        [Display(Name = "押金收取日期")]
        public DateTime? DepositDate { get; set; }
        /// <summary>
        /// 餐厅模型
        /// </summary>
        /// <value>The loading car info.</value>
        [JsonIgnore]
        public ICollection<RestaurantTypeNumberDto> RestaurantTypenNumberInfos { get; set; }

        [IgnoreMap]
        public RestaurantUser User { get; set; }
        public long? CreatorUserId { get; set; }
        public DateTime CreationTime { get; set; }

        public int Stock { get; set; } = 0;

        /// <summary>
        /// 实际店存
        /// </summary>
        public int RealStock { get; set; } = 0;
    }
     [AutoMap(typeof(User))]
     public class RestaurantUser{
        public string Mobile { get; set; }
        public string UserName { get; set; }
        public string Name { get; set; }
        public string Surname { get; set; }
    }
}
